// Copyright under GPL, Mohamed Mansour 2009 (http://mohamedmansour.com)

// Add a keyboard listener on keyup.
/*if (window == top) {
  window.addEventListener('keyup', keyListener, false);
}*/

/**
* Keyboard keyup listener callback.
*/
function keyListener(e) {
   //capture ctrl + m
  if (e.ctrlKey && e.keyCode==77) {
     var description = prompt("TimeMark description:","");
     chrome.extension.sendRequest({
        'description': description,
        "action" : "addTimeMark"
     },function(){
        alert("TimeMark added!");
     });
  }
}
